<template>
  <div class="all">
    <!-- 五：实验内容及实验数据记录与处理 -->
    <div>
                <div>
                    <div>
                        <!-- 1.自组式直流电桥测量电阻值 -->
                        <hot-table
                        :settings="ziZuSettingsOne"
                        :rowHeaders="true"
                        :colHeaders="true">
                        </hot-table>
                        <hot-table
                        :settings="ziZuSettingsTow"
                        :rowHeaders="true"
                        :colHeaders="true">
                        </hot-table>
                        <hot-table
                        :settings="ziZuSettingsThree"
                        :rowHeaders="true"
                        :colHeaders="true">
                        </hot-table>
                        <hot-table
                        :settings="ziZuSettingsFour"
                        :rowHeaders="true"
                        :colHeaders="true">
                        </hot-table>
                    </div>
                </div>
        </div>
    <el-form
    :model="Form"
    :rules="rules"
    ref="Form"
    class="Form"
    >
      <h4>一、选择题</h4>
      <div>1.在使用箱式直流电桥测量电阻时，为什么选取的比例臂一般应使单电桥的四个测量盘尽可能用上？(  )</div>
      <el-form-item prop="one">
        <el-radio-group v-model="Form.one">
          <el-radio label="A">A. 测量盘必须全用上</el-radio>
          <el-radio label="B">B. 比例臂的选取与测量盘使用个数无关</el-radio>
          <el-radio label="C">C. 使用一个测量盘时，读出的测量值精度最高</el-radio>
          <el-radio label="D">D. 读出的测量值有效位数多，测量精度有保证</el-radio>
        </el-radio-group>
      </el-form-item>
      <div>2.为了提高电桥测量的灵敏度，应采取哪些措施?:(  )</div>
      <el-form-item prop="two">
        <el-radio-group v-model="Form.two">
          <el-radio label="A">A. 提高电源电压</el-radio>
          <el-radio label="B">B. 使用低灵敏度检流计</el-radio>
          <el-radio label="C">C. 比例臂可以随意选取</el-radio>
          <el-radio label="D">D. 不使用等臂电桥</el-radio>
        </el-radio-group>
      </el-form-item>
          <h4>二、判断题</h4>
      <div>1.因为电桥箱是设计生产精良的专业实验仪器，电桥箱中的检流计不用调零。( )</div>
       <el-form-item prop="pone">
        <el-radio-group v-model="Form.pone">
          <el-radio label="0">正确</el-radio>
          <el-radio label="1">错误</el-radio>
        </el-radio-group>
      </el-form-item>

      <div>2.在电阻值的测量过程中，只用按下内接检流计开关这一个开关。( )</div>
      <el-form-item prop="ptwo">
        <el-radio-group v-model="Form.ptwo">
          <el-radio label="0">正确</el-radio>
          <el-radio label="1">错误</el-radio>
        </el-radio-group>
      </el-form-item>
      <h4>线上资源</h4>
      <p class="addmargin">
        1）在线实验报告系统链接：
        <a style="text-decoration: none;" href="http://180.76.111.200:3001/"
          >http://180.76.111.200:3001/</a
        >
      </p>
      <el-form-item class="footer">
        <el-button plain class="btn" type="primary" @click="storage()"
          >暂存</el-button
        >
        <el-button class="btn" type="primary" @click="send(Form)"
          >提交</el-button
        >
      </el-form-item>
    </el-form>
       <!-- 暂存按钮的弹窗 -->
       <el-dialog title="提示" :visible.sync="DialogVisible" width="30%" center>
      <el-divider></el-divider>
      <div style="text-align: center">
         请 您 确 定 您 是 否 要 暂 存 ？
      </div>
      <el-divider></el-divider>
      <span slot="footer" class="dialog-footer">
        <el-button plain @click="DialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="(DialogVisible = false), storageOk()"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { HotTable } from "@handsontable/vue";
import { registerAllModules } from "handsontable/registry";
import "handsontable/dist/handsontable.full.css";

registerAllModules();

  export default {
    components: {
    HotTable,
  },
    data() {
      return {
        // 1.自组式直流电桥测量电阻值
        ziZuSettingsOne: {
        manualRowResize: true, // 自定义行宽
        manualColumnResize: true, // 自定义列高
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
         // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "R1(Ω)",
            number: "500",
            number1: "2000",
            number2: "100",
            rx: "RX = ",
            danWei: "Ω",
          },
          {
            conent: "R2(Ω)",
            number: "500",
            number1: "2000",
            number2: "100",
          },
          {
            conent: "电阻臂R0(Ω)",
          },
          {
            conent: "待测电阻值RX(Ω)",
          },
        ],
        //最大列
        maxCols: 7,
        //最大行
        maxRows: 4,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 合并的列
        mergeCells: [
          { row: 0, col: 4, rowspan: 4, colspan: 1 },
          { row: 0, col: 5, rowspan: 4, colspan: 1 },
          { row: 0, col: 6, rowspan: 4, colspan: 1 },
        ],
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 4) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 6) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 150,
          },
          // 第二列
          {
            data: "number",
            width: 120,
            // type: "numeric",
            // 设置显示格式
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第三列
          {
            data: "number1",
            width: 120,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第四列
          {
            data: "number2",
            width: 120,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第五列
          {
            data: "rx",
            width: 50,
          },
          // 第六列
          {
            data: "",
            width: 100,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第七列
          {
            data: "danWei",
            width: 50,
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          //第一行
          [
            {
              label: "1.自组式直流电桥测量电阻值",
              colspan: 7,
            },
          ],
          // 第二行
          [
            {
              label: "测量内容↓ " + " " + " 测量次数→",
            },
            {
              label: "1",
            },
            {
              label: "2",
            },
            {
              label: "3",
            },
            {
              label: "测量结果",
              colspan: 3,
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          // console.log(this.getData());
          const zizura1 = window.localStorage.getItem("zizura1");
          // console.log(xiangshira1);
          if (zizura1 !== "null") {
            // this.getData()[1][1] = xiangshira1
            this.setDataAtCell(2, 1, zizura1);
          }
          const zizura2 = window.localStorage.getItem("zizura2");
          if (zizura2 !== "null") {
            this.setDataAtCell(2, 2, zizura2);
          }
          const zizura3 = window.localStorage.getItem("zizura3");
          if (zizura3 !== "null") {
            this.setDataAtCell(2, 3, zizura3);
          }
          const zizurx_a1 = window.localStorage.getItem("zizurx_a1");
          if (zizurx_a1 !== "null") {
            this.setDataAtCell(3, 1, zizurx_a1);
          }
          const zizurx_a2 = window.localStorage.getItem("zizurx_a2");
          if (zizurx_a2 !== "null") {
            this.setDataAtCell(3, 2, zizurx_a2);
          }
          const zizurx_a3 = window.localStorage.getItem("zizurx_a3");
          if (zizurx_a3 !== "null") {
            this.setDataAtCell(3, 3, zizurx_a3);
          }
          const zizurx = window.localStorage.getItem("zizurx");
          if (zizurx !== "null") {
            this.setDataAtCell(0, 5, zizurx);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          // console.log(changes);//null
          // console.log(source);
          // console.log(this.getCellEditor());//获取全部的值
          // 挨个获取需要传给后端的值
          // console.log(this.getData()[1][1]);
          const ra1 = this.getData()[2][1];
          sessionStorage.setItem("ra1", ra1);
          // console.log(this.getData()[1][2]);
          const ra2 = this.getData()[2][2];
          sessionStorage.setItem("ra2", ra2);
          // console.log(this.getData()[1][3]);
          const ra3 = this.getData()[2][3];
          sessionStorage.setItem("ra3", ra3);
          // console.log(this.getData()[2][1]);
          const rx_a1 = this.getData()[3][1];
          sessionStorage.setItem("rx_a1", rx_a1);
          // console.log(this.getData()[2][2]);
          const rx_a2 = this.getData()[3][2];
          sessionStorage.setItem("rx_a2", rx_a2);
          // console.log(this.getData()[2][3]);
          const rx_a3 = this.getData()[3][3];
          sessionStorage.setItem("rx_a3", rx_a3);
          // console.log(this.getData()[0][5]);
          const rx = this.getData()[0][5];
          sessionStorage.setItem("rx", rx);
        },
        },
        ziZuSettingsTow: {
        rowHeights: 30,
        // 数据部分
        data: [
          // 定义行，一共有3行
          {
            conent: "电阻臂R0(Ω)",
            rx: "S = ",
          },
          {
            conent: "偏转格数Δn",
            number: "1",
            number1: "2",
            number2: "3",
          },
          {
            conent: "变化量Δ0(Ω)",
          },
          {
            conent: "电桥灵敏度S",
          },
        ],
        //最大列
        maxCols: 7,
        //最大行
        maxRows: 4,
        autoColumnSize: true, // 自适应列大小
        // customBorders:[],//添加边框
        // 合并的列
        mergeCells: [
          { row: 0, col: 4, rowspan: 4, colspan: 1 },
          { row: 0, col: 5, rowspan: 4, colspan: 2 },
        ],
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 4) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 6) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 3 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 150,
          },
          // 第二列
          {
            data: "number",
            width: 120,
            // type: "numeric",
          },
          // 第三列
          {
            data: "number1",
            width: 120,
            // type: "numeric",
          },
          // 第四列
          {
            data: "number2",
            width: 120,
            // type: "numeric",
          },
          // 第五列
          {
            data: "rx",
            width: 100,
          },
          // 第六列
          {
            data: "",
            width: 100,
            // type: "numeric",
          },
          // 第七列
          {
            data: "danWei",
            width: 10,
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          //第一行
          [
            {
              label: "2.测量并计算自组式直流电桥的灵敏度",
              colspan: 7,
            },
          ],
          // 第二行
          [
            {
              label: "测量内容↓ " + " " + " 测量次数→",
            },
            {
              label: "1",
            },
            {
              label: "2",
            },
            {
              label: "3",
            },
            {
              label: "测量结果",
              colspan: 3,
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          const zizurb1 = window.localStorage.getItem("zizurb1");
          if (zizurb1 !== "null") {
            this.setDataAtCell(0, 1, zizurb1);
          }
          const zizurb2 = window.localStorage.getItem("zizurb2");
          if (zizurb2 !== "null") {
            this.setDataAtCell(0, 2, zizurb2);
          }
          const zizurb3 = window.localStorage.getItem("zizurb3");
          if (zizurb3 !== "null") {
            this.setDataAtCell(0, 3, zizurb3);
          }
          const zizura_change1 = window.localStorage.getItem("zizura_change1");
          if (zizura_change1 !== "null") {
            this.setDataAtCell(2, 1, zizura_change1);
          }
          const zizura_change2 =
            window.localStorage.getItem("zizura_change2");
          if (zizura_change2 !== "null") {
            this.setDataAtCell(2, 2, zizura_change2);
          }
          const zizura_change3 =
            window.localStorage.getItem("zizura_change3");
          if (zizura_change3 !== "null") {
            this.setDataAtCell(2, 3, zizura_change3);
          }
          const zizus1 = window.localStorage.getItem("zizus1");
          if (zizus1 !== "null") {
            this.setDataAtCell(3, 1, zizus1);
          }
          const zizus2 = window.localStorage.getItem("zizus2");
          if (zizus2 !== "null") {
            this.setDataAtCell(3, 2, zizus2);
          }
          const zizus3 = window.localStorage.getItem("zizus3");
          if (zizus3 !== "null") {
            this.setDataAtCell(3, 3, zizus3);
          }
          const zizus = window.localStorage.getItem("zizus");
          if (zizus !== "null") {
            this.setDataAtCell(0, 5, zizus);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          // console.log(changes);//null
          // console.log(source);
          // console.log(this.getData()); //获取全部的值
          // 挨个获取需要传给后端的值
          // console.log(this.getData()[1][1]);
          const rb1 = this.getData()[0][1];
          sessionStorage.setItem("rb1", rb1);
          // console.log(this.getData()[1][2]);
          const rb2 = this.getData()[0][2];
          sessionStorage.setItem("rb2", rb2);
          // console.log(this.getData()[1][3]);
          const rb3 = this.getData()[0][3];
          sessionStorage.setItem("rb3", rb3);
          // console.log(this.getData()[2][1]);
          const ra_change1 = this.getData()[2][1];
          sessionStorage.setItem("ra_change1", ra_change1);
          // console.log(this.getData()[2][2]);
          const ra_change2 = this.getData()[2][2];
          sessionStorage.setItem("ra_change2", ra_change2);
          // console.log(this.getData()[2][3]);
          const ra_change3 = this.getData()[2][3];
          sessionStorage.setItem("ra_change3", ra_change3);
          const s1 = this.getData()[3][1];
          sessionStorage.setItem("s1", s1);
          // console.log(this.getData()[2][2]);
          const s2 = this.getData()[3][2];
          sessionStorage.setItem("s2", s2);
          // console.log(this.getData()[2][3]);
          const s3 = this.getData()[3][3];
          sessionStorage.setItem("s3", s3);
          // console.log(this.getData()[0][5]);
          const s = this.getData()[0][5];
          sessionStorage.setItem("s", s);
        },
      },
      ziZuSettingsThree: {
        manualRowResize: true, // 自定义行宽
        manualColumnResize: true, // 自定义列高
        preventOverflow: "vertical", // 防止水平溢出表
        headerTooltips: true, // header 内容过长提示
         // 数据部分
        data: [
          // 定义行，一共有4行
          {
            conent: "R1(Ω)",
            number: "200",
            number1: "500",
            number2: "1000",
            rx: "RX = ",
            danWei: "Ω",
          },
          {
            conent: "R2(Ω)",
            number: "100",
            number1: "1000",
            number2: "4000",
          },
          {
            conent: "电阻臂R0(Ω)",
          },
          {
            conent: "待测电阻值RX(Ω)",
          },
        ],
        //最大列
        maxCols: 7,
        //最大行
        maxRows: 4,
        autoColumnSize: true, // 自适应列大小
        rowHeights: 30,
        // customBorders:[],//添加边框
        // 合并的列
        mergeCells: [
          { row: 0, col: 4, rowspan: 4, colspan: 1 },
          { row: 0, col: 5, rowspan: 4, colspan: 1 },
          { row: 0, col: 6, rowspan: 4, colspan: 1 },
        ],
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 4) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 6) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 150,
          },
          // 第二列
          {
            data: "number",
            width: 120,
            // type: "numeric",
            // 设置显示格式
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第三列
          {
            data: "number1",
            width: 120,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第四列
          {
            data: "number2",
            width: 120,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第五列
          {
            data: "rx",
            width: 50,
          },
          // 第六列
          {
            data: "",
            width: 100,
            // type: "numeric",
            // numericFormat: {
            //   pattern: "0.00",
            // },
          },
          // 第七列
          {
            data: "danWei",
            width: 50,
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          //第一行
          [
            {
              label: "3.自组式直流电桥测量电阻值",
              colspan: 7,
            },
          ],
          // 第二行
          [
            {
              label: "测量内容↓ " + " " + " 测量次数→",
            },
            {
              label: "1",
            },
            {
              label: "2",
            },
            {
              label: "3",
            },
            {
              label: "测量结果",
              colspan: 3,
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          // console.log(this.getData());
          const zizurc1 = window.localStorage.getItem("zizurc1");
          // console.log(xiangshira1);
          if (zizurc1 !== "null") {
            // this.getData()[1][1] = xiangshira1
            this.setDataAtCell(2, 1, zizurc1);
          }
          const zizurc2 = window.localStorage.getItem("zizurc2");
          if (zizurc2 !== "null") {
            this.setDataAtCell(2, 2, zizurc2);
          }
          const zizurc3 = window.localStorage.getItem("zizurc3");
          if (zizurc3 !== "null") {
            this.setDataAtCell(2, 3, zizurc3);
          }
          const zizurx_b1 = window.localStorage.getItem("zizurx_b1");
          if (zizurx_b1 !== "null") {
            this.setDataAtCell(3, 1, zizurx_b1);
          }
          const zizurx_b2 = window.localStorage.getItem("zizurx_b2");
          if (zizurx_b2 !== "null") {
            this.setDataAtCell(3, 2, zizurx_b2);
          }
          const zizurx_b3 = window.localStorage.getItem("zizurx_b3");
          if (zizurx_b3 !== "null") {
            this.setDataAtCell(3, 3, zizurx_b3);
          }
          const zizurxx = window.localStorage.getItem("zizurxx");
          if (zizurxx !== "null") {
            this.setDataAtCell(0, 5, zizurxx);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          // console.log(changes);//null
          // console.log(source);
          // console.log(this.getCellEditor());//获取全部的值
          // 挨个获取需要传给后端的值
          // console.log(this.getData()[1][1]);
          const rc1 = this.getData()[2][1];
          sessionStorage.setItem("rc1", rc1);
          // console.log(this.getData()[1][2]);
          const rc2 = this.getData()[2][2];
          sessionStorage.setItem("rc2", rc2);
          // console.log(this.getData()[1][3]);
          const rc3 = this.getData()[2][3];
          sessionStorage.setItem("rc3", rc3);
          // console.log(this.getData()[2][1]);
          const rx_b1 = this.getData()[3][1];
          sessionStorage.setItem("rx_b1", rx_b1);
          // console.log(this.getData()[2][2]);
          const rx_b2 = this.getData()[3][2];
          sessionStorage.setItem("rx_b2", rx_b2);
          // console.log(this.getData()[2][3]);
          const rx_b3 = this.getData()[3][3];
          sessionStorage.setItem("rx_b3", rx_b3);
          // console.log(this.getData()[0][5]);
          const rxx = this.getData()[0][5];
          sessionStorage.setItem("rxx", rxx);
        },
        },
        ziZuSettingsFour: {
        rowHeights: 30,
        // 数据部分
        data: [
          // 定义行，一共有3行
          {
            conent: "电阻臂R0(Ω)",
            rx: "S = ",
          },
          {
            conent: "偏转格数Δn",
            number: "1",
            number1: "1",
            number2: "1",
          },
          {
            conent: "变化量Δ0(Ω)",
          },
          {
            conent: "电桥灵敏度S",
          },
        ],
        //最大列
        maxCols: 7,
        //最大行
        maxRows: 4,
        autoColumnSize: true, // 自适应列大小
        // customBorders:[],//添加边框
        // 合并的列
        mergeCells: [
          { row: 0, col: 4, rowspan: 4, colspan: 1 },
          { row: 0, col: 5, rowspan: 4, colspan: 2 },
        ],
        // 是否展示行表头,默认是1,2,3等数据,可以['行1','行2']进行自定义展示
        // rowHeaders: ['比例臂','电阻臂R0(Ω)','待测电阻值RX(Ω)'],
        height: "auto",
        // 设置表里的文字水平 + 垂直居中
        className: "htCenter htMiddle",
        rowHeaders: false,
        // 设置固定单元格不可修改
        cells(row, colum) {
          const cellProperties = {};
          if (row === 0 && colum === 0) {
            // cellProperties.editor = false;
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 1) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 2) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 3) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 4) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 0 && colum === 6) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 1 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 2 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          if (row === 3 && colum === 0) {
            cellProperties.readOnly = true;
          } else {
            cellProperties.editor = "text";
          }
          return cellProperties;
        },
        // 设置列
        columns: [
          // 第一列
          {
            data: "conent",
            editor: false,
            type: "text",
            width: 150,
          },
          // 第二列
          {
            data: "number",
            width: 120,
            // type: "numeric",
          },
          // 第三列
          {
            data: "number1",
            width: 120,
            // type: "numeric",
          },
          // 第四列
          {
            data: "number2",
            width: 120,
            // type: "numeric",
          },
          // 第五列
          {
            data: "rx",
            width: 100,
          },
          // 第六列
          {
            data: "",
            width: 100,
            // type: "numeric",
          },
          // 第七列
          {
            data: "danWei",
            width: 10,
          },
        ],
        // colHeaders: false,
        // 设置表头 + 表头合并
        nestedHeaders: [
          //第一行
          [
            {
              label: "4.测量并计算自组式直流电桥的灵敏度",
              colspan: 7,
            },
          ],
          // 第二行
          [
            {
              label: "测量内容↓ " + " " + " 测量次数→",
            },
            {
              label: "1",
            },
            {
              label: "2",
            },
            {
              label: "3",
            },
            {
              label: "测量结果",
              colspan: 3,
            },
          ],
        ],
        //自动换行
        autoWrapRow: true,
        // 设置非商业用途属性
        licenseKey: "non-commercial-and-evaluation",
        // 更新设置，暂存显示
        afterUpdateSettings() {
          const zizurb1 = window.localStorage.getItem("zizurb1");
          if (zizurb1 !== "null") {
            this.setDataAtCell(0, 1, zizurb1);
          }
          const zizurb2 = window.localStorage.getItem("zizurb2");
          if (zizurb2 !== "null") {
            this.setDataAtCell(0, 2, zizurb2);
          }
          const zizurb3 = window.localStorage.getItem("zizurb3");
          if (zizurb3 !== "null") {
            this.setDataAtCell(0, 3, zizurb3);
          }
          const zizura_change1 = window.localStorage.getItem("zizura_change1");
          if (zizura_change1 !== "null") {
            this.setDataAtCell(2, 1, zizura_change1);
          }
          const zizura_change2 =
            window.localStorage.getItem("zizura_change2");
          if (zizura_change2 !== "null") {
            this.setDataAtCell(2, 2, zizura_change2);
          }
          const zizura_change3 =
            window.localStorage.getItem("zizura_change3");
          if (zizura_change3 !== "null") {
            this.setDataAtCell(2, 3, zizura_change3);
          }
          const zizus1 = window.localStorage.getItem("zizus1");
          if (zizus1 !== "null") {
            this.setDataAtCell(3, 1, zizus1);
          }
          const zizus2 = window.localStorage.getItem("zizus2");
          if (zizus2 !== "null") {
            this.setDataAtCell(3, 2, zizus2);
          }
          const zizus3 = window.localStorage.getItem("zizus3");
          if (zizus3 !== "null") {
            this.setDataAtCell(3, 3, zizus3);
          }
          const zizus = window.localStorage.getItem("zizus");
          if (zizus !== "null") {
            this.setDataAtCell(0, 5, zizus);
          }
        },
        //数据改变时触发此方法
        afterChange: function (changes, source) {
          // console.log(changes);//null
          // console.log(source);
          // console.log(this.getData()); //获取全部的值
          // 挨个获取需要传给后端的值
          // console.log(this.getData()[1][1]);
          const rd1 = this.getData()[0][1];
          sessionStorage.setItem("rd1", rd1);
          // console.log(this.getData()[1][2]);
          const rd2 = this.getData()[0][2];
          sessionStorage.setItem("rd2", rd2);
          // console.log(this.getData()[1][3]);
          const rd3 = this.getData()[0][3];
          sessionStorage.setItem("rd3", rd3);
          // console.log(this.getData()[2][1]);
          const rb_change1 = this.getData()[2][1];
          sessionStorage.setItem("rb_change1", rb_change1);
          // console.log(this.getData()[2][2]);
          const rb_change2 = this.getData()[2][2];
          sessionStorage.setItem("rb_change2", rb_change2);
          // console.log(this.getData()[2][3]);
          const rb_change3 = this.getData()[2][3];
          sessionStorage.setItem("rb_change3", rb_change3);
          const ss1 = this.getData()[3][1];
          sessionStorage.setItem("ss1", ss1);
          // console.log(this.getData()[2][2]);
          const ss2 = this.getData()[3][2];
          sessionStorage.setItem("ss2", ss2);
          // console.log(this.getData()[2][3]);
          const ss3 = this.getData()[3][3];
          sessionStorage.setItem("ss3", ss3);
          // console.log(this.getData()[0][5]);
          const ss = this.getData()[0][5];
          sessionStorage.setItem("ss", ss);
        },
      },
        
        tableState: {
          ra1:'',
          ra2:'',
          ra3:'',
          rx_a1:'',
          rx_a2:'',
          rx_a3:'',
          rx:'',

          rb1:'',
          rb2:'',
          rb3:'',
          ra_change1:'',
          ra_change2:'',
          ra_change3:'',
          s1:'',
          s2:'',
          s3:'',
          s:'',

          rc1:'',
          rc2:'',
          rc3:'',
          rx_b1:'',
          rx_b2:'',
          rx_b3:'',
          rxx:'',

          rd1:'',
          rd2:'',
          rd3:'',
          rb_change1:'',
          rb_change2:'',
          rb_change3:'',
          ss1:'',
          ss2:'',
          ss3:'',
          ss:'',
        },
        xz1:'',
          xz2:'',
          pd1:'',
          pd2:'',
          grade_xp:0,
        Form: {
          one: "",
          two: "",
          pone: "",
          ptwo: "",
        },
        rules: {
          one: [{ required: true, message: "请选择", trigger: "change" }],
          two: [{ required: true, message: "请选择", trigger: "change" }],
          pone: [{ required: true, message: "请选择", trigger: "change" }],
          ptwo: [{ required: true, message: "请选择", trigger: "change" }],
        },
// 暂存
      DialogVisible: false
      }
    },
    created() {
    // 暂存
    this.storageCheck();
    localStorage.setItem("state5", 1);
  },
  // 暂存
  //1 首先进入页面的时候需要监听浏览器的后退按钮，之后在操作的时候执行函数,在mounted中挂载去监听这个事件，并在methods里面添加函数，用来判断执行的条件
  mounted() {
    if (window.history && window.history.pushState) {
      history.pushState(null, null, document.URL);
      const state5 = localStorage.getItem("state5");
      // console.log(state5);
      window.addEventListener("popstate", this.back, false);
    }
  },
  // 暂存
  // 2：需要在退出页面的时候销毁这个监听事件
  destroyed() {
    window.removeEventListener("popstate", this.back, false);
  },
    methods: {
          // 暂存
    back() {
      // console.log(123);
      const state5 = localStorage.getItem("state5");
      // console.log(state5);
      if (state5 == 1) {
        // console.log(1111);
        this.$confirm(
          "检测到未保存的内容，是否在离开页面前保存？",
          "确认信息",
          {
            confirmButtonText: "暂存",
            cancelButtonText: "放弃修改",
            type: "warning",
            center: true
          }
        )
          .then(() => {
            // this.$router.go(-1)
            // this.DialogVisible = true
            const state5 = localStorage.getItem("state5");
            // console.log(state5);
            // this.$message({
            //   type: "success",
            //   message: "暂存成功！",
            // });
            this.BackStorage();
            if (this.$route.path !== "/home") {
              this.$router.push({ path: "/home" });
            }
            // this.$router.push("/home");
            return false;
          })
          .catch(() => {
            // const state5 = sessionStorage.getItem('state5')
            // console.log(state5)
            this.$message({
              type: "info",
              message: "已取消暂存！",
            });
            if (this.$route.path !== "/home") {
              this.$router.push({ path: "/home" });
            }
            // this.giveUp()
            return false;
          });
      } else {
        // console.log(2222);
        this.$router.push({ path: "/home" });
      }
    },
    // 暂存
    // 放弃保存
    giveUp() {
      // console.log(345);
      window.localStorage.clear();
      if (this.$route.path !== "/home") {
        this.$router.push({ path: "/home" });
      }
    },
      async send(val) {
      // console.log(val);
        for (var key in this.tableState) {
          if (this.tableState[key] == 'null') {
          // console.log(this.tableState[key]);
          this.$message.error("题目未做完！");
          return false;
        }
      }
      for (var key in this.tableState) {
        // console.log(this.form2[key]);
        if (!this.tableState[key]) {
          // console.log(key);
          // console.log(this.tableState[key]);
          this.$message.error("题目未做完！");
          return false;
        }
      }
        for (var key in this.Form) {
        // console.log(this.form2[key]);
        if (this.Form[key] == 'null') {
          // console.log(this.Form[key]);
          this.$message.error("题目未做完！");
          return false;
        }
      }
      for (var key in this.Form) {
        // console.log(this.form2[key]);
        if (!this.Form[key]) {
          // console.log(key);
          // console.log(this.Form[key]);
          this.$message.error("题目未做完！");
          return false;
        }
      }
      const ra1 = sessionStorage.getItem("ra1");
      this.tableState.ra1 = ra1;
      const ra2 = sessionStorage.getItem("ra2");
      this.tableState.ra2 = ra2;
      const ra3 = sessionStorage.getItem("ra3");
      this.tableState.ra3 = ra3;
      const rx_a1 = sessionStorage.getItem("rx_a1");
      this.tableState.rx_a1 = rx_a1;
      const rx_a2 = sessionStorage.getItem("rx_a2");
      this.tableState.rx_a2 = rx_a2;
      const rx_a3 = sessionStorage.getItem("rx_a3");
      this.tableState.rx_a3 = rx_a3;
      const rx = sessionStorage.getItem("rx");
      this.tableState.rx = rx;
      const rb1 = sessionStorage.getItem("rb1");
      this.tableState.rb1 = rb1;
      const rb2 = sessionStorage.getItem("rb2");
      this.tableState.rb2 = rb2;
      const rb3 = sessionStorage.getItem("rb3");
      this.tableState.rb3 = rb3;
      const ra_change1 = sessionStorage.getItem("ra_change1");
      this.tableState.ra_change1 = ra_change1;
      const ra_change2 = sessionStorage.getItem("ra_change2");
      this.tableState.ra_change2 = ra_change2;
      const ra_change3 = sessionStorage.getItem("ra_change3");
      this.tableState.ra_change3 = ra_change3;
      const s1 = sessionStorage.getItem("s1");
      this.tableState.s1 = s1;
      const s2 = sessionStorage.getItem("s2");
      this.tableState.s2 = s2;
      const s3 = sessionStorage.getItem("s3");
      this.tableState.s3 = s3;
      const s = sessionStorage.getItem("s");
      this.tableState.s = s;
      const rc1 = sessionStorage.getItem("rc1");
      this.tableState.rc1 = rc1;
      const rc2 = sessionStorage.getItem("rc2");
      this.tableState.rc2 = rc2;
      const rc3 = sessionStorage.getItem("rc3");
      this.tableState.rc3 = rc3;
      const rx_b1 = sessionStorage.getItem("rx_b1");
      this.tableState.rx_b1 = rx_b1;
      const rx_b2 = sessionStorage.getItem("rx_b2");
      this.tableState.rx_b2 = rx_b2;
      const rx_b3 = sessionStorage.getItem("rx_b3");
      this.tableState.rx_b3 = rx_b3;
      const rxx = sessionStorage.getItem("rxx");
      this.tableState.rxx = rxx;
      const rd1 = sessionStorage.getItem("rd1");
      this.tableState.rd1 = rd1;
      const rd2 = sessionStorage.getItem("rd2");
      this.tableState.rd2 = rd2;
      const rd3 = sessionStorage.getItem("rd3");
      this.tableState.rd3 = rd3;
      const rb_change1 = sessionStorage.getItem("rb_change1");
      this.tableState.rb_change1 = rb_change1;
      const rb_change2 = sessionStorage.getItem("rb_change2");
      this.tableState.rb_change2 = rb_change2;
      const rb_change3 = sessionStorage.getItem("rb_change3");
      this.tableState.rb_change3 = rb_change3;
      const ss1 = sessionStorage.getItem("ss1");
      this.tableState.ss1 = ss1;
      const ss2 = sessionStorage.getItem("ss2");
      this.tableState.ss2 = ss2;
      const ss3 = sessionStorage.getItem("ss3");
      this.tableState.ss3 = ss3;
      const ss = sessionStorage.getItem("ss");
      this.tableState.ss = ss;

        var xz1 =val.one;
        var xz2 =val.two;
        var pd1 =val.pone;
        var pd2 =val.ptwo;
        var grade_xp = this.grade_xp;
        var studentId = window.localStorage.getItem("StudentId");
        this.grade_xp =0;
        if(val.one == 'A') {
          this.grade_xp += 10
        }
        if(val.two == 'C') {
          this.grade_xp += 10
        }
        if(val.pone == '0') {
          this.grade_xp += 6
        }
        if(val.ptwo == '1') {
          this.grade_xp += 6
        }
        // console.log(this.grade_xp);
        const { data: res } = await this.$http.post('/api/zizu/luru',{
            student_id: studentId,
            grade_xp: this.grade_xp,
            ra1:this.tableState.ra1,
            ra2:this.tableState.ra2,
            ra3:this.tableState.ra3,
            rx_a1:this.tableState.rx_a1,
            rx_a2:this.tableState.rx_a2,
            rx_a3:this.tableState.rx_a3,
            rx:this.tableState.rx,

            rb1:this.tableState.rb1,
            rb2:this.tableState.rb2,
            rb3:this.tableState.rb3,
            ra_change1:this.tableState.ra_change1,
            ra_change2:this.tableState.ra_change2,
            ra_change3:this.tableState.ra_change3,
            s1:this.tableState.s1,
            s2:this.tableState.s2,
            s3:this.tableState.s3,
            s:this.tableState.s,

            rc1:this.tableState.rc1,
            rc2:this.tableState.rc2,
            rc3:this.tableState.rc3,
            rx_b1:this.tableState.rx_b1,
            rx_b2:this.tableState.rx_b2,
            rx_b3:this.tableState.rx_b3,
            rxx:this.tableState.rxx,

            rd1:this.tableState.rd1,
            rd2:this.tableState.rd2,
            rd3:this.tableState.rd3,
            rb_change1:this.tableState.rb_change1,
            rb_change2:this.tableState.rb_change2,
            rb_change3:this.tableState.rb_change3,
            ss1:this.tableState.ss1,
            ss2:this.tableState.ss2,
            ss3:this.tableState.ss3,
            ss:this.tableState.ss,

            xz1:xz1,
            xz2:xz2,
            pd1:pd1,
            pd2:pd2,
        })
        // console.log(res);
        if(res.data.res1 == false) {
        this.$message.error("请勿重复提交！");
        this.$router.push("/home");
      } else {
        if (res.code == 100) {
          this.$message.error("提交失败！");
          this.grade_xp =0;
        }
        if (res.code == 150) {
          this.$message.error("请勿重复提交！");
        }
        if (res.code == 422) {
          this.$message.error("请填完所有题目");
          this.grade_xp =0;
        }
        if (res.code == 200) {
           // 暂存
           window.localStorage.clear();
          this.$message.success("提交成功！");
          // localStorage.setItem("state5", 2);
          this.$router.push("/home");
        }
      }
      },
       // 暂存弹窗出现
    storage() {
          this.DialogVisible = true;
    },
    // 暂存弹窗里面的确定按钮
    storageOk() {
      const ra1 = sessionStorage.getItem("ra1");
      this.tableState.ra1 = ra1;
      const ra2 = sessionStorage.getItem("ra2");
      this.tableState.ra2 = ra2;
      const ra3 = sessionStorage.getItem("ra3");
      this.tableState.ra3 = ra3;
      const rx_a1 = sessionStorage.getItem("rx_a1");
      this.tableState.rx_a1 = rx_a1;
      const rx_a2 = sessionStorage.getItem("rx_a2");
      this.tableState.rx_a2 = rx_a2;
      const rx_a3 = sessionStorage.getItem("rx_a3");
      this.tableState.rx_a3 = rx_a3;
      const rx = sessionStorage.getItem("rx");
      this.tableState.rx = rx;
      const rb1 = sessionStorage.getItem("rb1");
      this.tableState.rb1 = rb1;
      const rb2 = sessionStorage.getItem("rb2");
      this.tableState.rb2 = rb2;
      const rb3 = sessionStorage.getItem("rb3");
      this.tableState.rb3 = rb3;
      const ra_change1 = sessionStorage.getItem("ra_change1");
      this.tableState.ra_change1 = ra_change1;
      const ra_change2 = sessionStorage.getItem("ra_change2");
      this.tableState.ra_change2 = ra_change2;
      const ra_change3 = sessionStorage.getItem("ra_change3");
      this.tableState.ra_change3 = ra_change3;
      const s1 = sessionStorage.getItem("s1");
      this.tableState.s1 = s1;
      const s2 = sessionStorage.getItem("s2");
      this.tableState.s2 = s2;
      const s3 = sessionStorage.getItem("s3");
      this.tableState.s3 = s3;
      const s = sessionStorage.getItem("s");
      this.tableState.s = s;
      const rc1 = sessionStorage.getItem("rc1");
      this.tableState.rc1 = rc1;
      const rc2 = sessionStorage.getItem("rc2");
      this.tableState.rc2 = rc2;
      const rc3 = sessionStorage.getItem("rc3");
      this.tableState.rc3 = rc3;
      const rx_b1 = sessionStorage.getItem("rx_b1");
      this.tableState.rx_b1 = rx_b1;
      const rx_b2 = sessionStorage.getItem("rx_b2");
      this.tableState.rx_b2 = rx_b2;
      const rx_b3 = sessionStorage.getItem("rx_b3");
      this.tableState.rx_b3 = rx_b3;
      const rxx = sessionStorage.getItem("rxx");
      this.tableState.rxx = rxx;
      const rd1 = sessionStorage.getItem("rd1");
      this.tableState.rd1 = rd1;
      const rd2 = sessionStorage.getItem("rd2");
      this.tableState.rd2 = rd2;
      const rd3 = sessionStorage.getItem("rd3");
      this.tableState.rd3 = rd3;
      const rb_change1 = sessionStorage.getItem("rb_change1");
      this.tableState.rb_change1 = rb_change1;
      const rb_change2 = sessionStorage.getItem("rb_change2");
      this.tableState.rb_change2 = rb_change2;
      const rb_change3 = sessionStorage.getItem("rb_change3");
      this.tableState.rb_change3 = rb_change3;
      const ss1 = sessionStorage.getItem("ss1");
      this.tableState.ss1 = ss1;
      const ss2 = sessionStorage.getItem("ss2");
      this.tableState.ss2 = ss2;
      const ss3 = sessionStorage.getItem("ss3");
      this.tableState.ss3 = ss3;
      const ss = sessionStorage.getItem("ss");
      this.tableState.ss = ss;

      window.localStorage.setItem("zizura1", this.tableState.ra1);
      window.localStorage.setItem("zizura2", this.tableState.ra2);
      window.localStorage.setItem("zizura3", this.tableState.ra3);
      window.localStorage.setItem("zizurx_a1", this.tableState.rx_a1);
      window.localStorage.setItem("zizurx_a2", this.tableState.rx_a2);
      window.localStorage.setItem("zizurx_a3", this.tableState.rx_a3);
      window.localStorage.setItem("zizurx", this.tableState.rx);
      window.localStorage.setItem("zizurb1", this.tableState.rb1);
      window.localStorage.setItem("zizurb2", this.tableState.rb2);
      window.localStorage.setItem("zizurb3", this.tableState.rb3);
      window.localStorage.setItem("zizura_change1", this.tableState.ra_change1);
      window.localStorage.setItem("zizura_change2", this.tableState.ra_change2);
      window.localStorage.setItem("zizura_change3", this.tableState.ra_change3);
      window.localStorage.setItem("zizus1", this.tableState.s1);
      window.localStorage.setItem("zizus2", this.tableState.s2);
      window.localStorage.setItem("zizus3", this.tableState.s3);
      window.localStorage.setItem("zizus", this.tableState.s);

      window.localStorage.setItem("zizurc1", this.tableState.rc1);
      window.localStorage.setItem("zizurc2", this.tableState.rc2);
      window.localStorage.setItem("zizurc3", this.tableState.rc3);
      window.localStorage.setItem("zizurx_b1", this.tableState.rx_b1);
      window.localStorage.setItem("zizurx_b2", this.tableState.rx_b2);
      window.localStorage.setItem("zizurx_b3", this.tableState.rx_b3);
      window.localStorage.setItem("zizurxx", this.tableState.rxx);
      window.localStorage.setItem("zizurd1", this.tableState.rd1);
      window.localStorage.setItem("zizurd2", this.tableState.rd2);
      window.localStorage.setItem("zizurd3", this.tableState.rd3);
      window.localStorage.setItem("zizurb_change1", this.tableState.rb_change1);
      window.localStorage.setItem("zizurb_change2", this.tableState.rb_change2);
      window.localStorage.setItem("zizurb_change3", this.tableState.rb_change3);
      window.localStorage.setItem("zizuss1", this.tableState.ss1);
      window.localStorage.setItem("zizuss2", this.tableState.ss2);
      window.localStorage.setItem("zizuss3", this.tableState.ss3);
      window.localStorage.setItem("zizuss", this.tableState.ss);
      // window.localStorage.setItem("zizuxz1", this.tableState.xz1);
      // window.localStorage.setItem("zizuxz2", this.tableState.xz2);
      // window.localStorage.setItem("zizupd1", this.tableState.pd1);
      // window.localStorage.setItem("zizupd2", this.tableState.pd2);
      // window.localStorage.setItem("zizugrade_xp", this.tableState.grade_xp);
      window.localStorage.setItem("zizuone", this.Form.one);
      window.localStorage.setItem("zizutwo", this.Form.two);
      window.localStorage.setItem("zizupone", this.Form.pone);
      window.localStorage.setItem("zizuptwo", this.Form.ptwo);
      this.$message({
        message: "暂存成功！",
        type: "success",
      });
      localStorage.setItem("state5", 2);
    },
    // 浏览器返回里面的暂存
    BackStorage() {
      const ra1 = sessionStorage.getItem("ra1");
      this.tableState.ra1 = ra1;
      const ra2 = sessionStorage.getItem("ra2");
      this.tableState.ra2 = ra2;
      const ra3 = sessionStorage.getItem("ra3");
      this.tableState.ra3 = ra3;
      const rx_a1 = sessionStorage.getItem("rx_a1");
      this.tableState.rx_a1 = rx_a1;
      const rx_a2 = sessionStorage.getItem("rx_a2");
      this.tableState.rx_a2 = rx_a2;
      const rx_a3 = sessionStorage.getItem("rx_a3");
      this.tableState.rx_a3 = rx_a3;
      const rx = sessionStorage.getItem("rx");
      this.tableState.rx = rx;

      const rb1 = sessionStorage.getItem("rb1");
      this.tableState.rb1 = rb1;
      const rb2 = sessionStorage.getItem("rb2");
      this.tableState.rb2 = rb2;
      const rb3 = sessionStorage.getItem("rb3");
      this.tableState.rb3 = rb3;
      const ra_change1 = sessionStorage.getItem("ra_change1");
      this.tableState.ra_change1 = ra_change1;
      const ra_change2 = sessionStorage.getItem("ra_change2");
      this.tableState.ra_change2 = ra_change2;
      const ra_change3 = sessionStorage.getItem("ra_change3");
      this.tableState.ra_change3 = ra_change3;
      const s1 = sessionStorage.getItem("s1");
      this.tableState.s1 = s1;
      const s2 = sessionStorage.getItem("s2");
      this.tableState.s2 = s2;
      const s3 = sessionStorage.getItem("s3");
      this.tableState.s3 = s3;
      const s = sessionStorage.getItem("s");
      this.tableState.s = s;

      const rc1 = sessionStorage.getItem("rc1");
      this.tableState.rc1 = rc1;
      const rc2 = sessionStorage.getItem("rc2");
      this.tableState.rc2 = rc2;
      const rc3 = sessionStorage.getItem("rc3");
      this.tableState.rc3 = rc3;
      const rx_b1 = sessionStorage.getItem("rx_b1");
      this.tableState.rx_b1 = rx_b1;
      const rx_b2 = sessionStorage.getItem("rx_b2");
      this.tableState.rx_b2 = rx_b2;
      const rx_b3 = sessionStorage.getItem("rx_b3");
      this.tableState.rx_b3 = rx_b3;
      const rxx = sessionStorage.getItem("rxx");
      this.tableState.rxx = rxx;

      const rd1 = sessionStorage.getItem("rd1");
      this.tableState.rd1 = rd1;
      const rd2 = sessionStorage.getItem("rd2");
      this.tableState.rd2 = rd2;
      const rd3 = sessionStorage.getItem("rd3");
      this.tableState.rd3 = rd3;
      const rb_change1 = sessionStorage.getItem("rb_change1");
      this.tableState.rb_change1 = rb_change1;
      const rb_change2 = sessionStorage.getItem("rb_change2");
      this.tableState.rb_change2 = rb_change2;
      const rb_change3 = sessionStorage.getItem("rb_change3");
      this.tableState.rb_change3 = rb_change3;
      const ss1 = sessionStorage.getItem("ss1");
      this.tableState.ss1 = ss1;
      const ss2 = sessionStorage.getItem("ss2");
      this.tableState.ss2 = ss2;
      const ss3 = sessionStorage.getItem("ss3");
      this.tableState.ss3 = ss3;
      const ss = sessionStorage.getItem("ss");
      this.tableState.ss = ss;

      window.localStorage.setItem("zizura1", this.tableState.ra1);
      window.localStorage.setItem("zizura2", this.tableState.ra2);
      window.localStorage.setItem("zizura3", this.tableState.ra3);
      window.localStorage.setItem("zizurx_a1", this.tableState.rx_a1);
      window.localStorage.setItem("zizurx_a2", this.tableState.rx_a2);
      window.localStorage.setItem("zizurx_a3", this.tableState.rx_a3);
      window.localStorage.setItem("zizurx", this.tableState.rx);
      
      window.localStorage.setItem("zizurb1", this.tableState.rb1);
      window.localStorage.setItem("zizurb2", this.tableState.rb2);
      window.localStorage.setItem("zizurb3", this.tableState.rb3);
      window.localStorage.setItem("zizura_change1", this.tableState.ra_change1);
      window.localStorage.setItem("zizura_change2", this.tableState.ra_change2);
      window.localStorage.setItem("zizura_change3", this.tableState.ra_change3);
      window.localStorage.setItem("zizus1", this.tableState.s1);
      window.localStorage.setItem("zizus2", this.tableState.s2);
      window.localStorage.setItem("zizus3", this.tableState.s3);
      window.localStorage.setItem("zizus", this.tableState.s);
      
      window.localStorage.setItem("zizurc1", this.tableState.rc1);
      window.localStorage.setItem("zizurc2", this.tableState.rc2);
      window.localStorage.setItem("zizurc3", this.tableState.rc3);
      window.localStorage.setItem("zizurx_b1", this.tableState.rx_b1);
      window.localStorage.setItem("zizurx_b2", this.tableState.rx_b2);
      window.localStorage.setItem("zizurx_b3", this.tableState.rx_b3);
      window.localStorage.setItem("zizurxx", this.tableState.rxx);
      
      window.localStorage.setItem("zizurd1", this.tableState.rd1);
      window.localStorage.setItem("zizurd2", this.tableState.rd2);
      window.localStorage.setItem("zizurd3", this.tableState.rd3);
      window.localStorage.setItem("zizurb_change1", this.tableState.rb_change1);
      window.localStorage.setItem("zizurb_change2", this.tableState.rb_change2);
      window.localStorage.setItem("zizurb_change3", this.tableState.rb_change3);
      window.localStorage.setItem("zizuss1", this.tableState.ss1);
      window.localStorage.setItem("zizuss2", this.tableState.ss2);
      window.localStorage.setItem("zizuss3", this.tableState.ss3);
      window.localStorage.setItem("zizuss", this.tableState.ss);
      // window.localStorage.setItem("zizuxz1", this.tableState.xz1);
      // window.localStorage.setItem("zizuxz2", this.tableState.xz2);
      // window.localStorage.setItem("zizupd1", this.tableState.pd1);
      // window.localStorage.setItem("zizupd2", this.tableState.pd2);
      // window.localStorage.setItem("zizugrade_xp", this.tableState.grade_xp);
      window.localStorage.setItem("zizuone", this.Form.one);
      window.localStorage.setItem("zizutwo", this.Form.two);
      window.localStorage.setItem("zizupone", this.Form.pone);
      window.localStorage.setItem("zizuptwo", this.Form.ptwo);
      this.$message({
        message: "暂存成功！",
        type: "success",
      });
      localStorage.setItem("state5", 2);
    },
    // 获取暂存里面的数据
    storageCheck() {
      const ra1 = window.localStorage.getItem("zizura1");
      this.tableState.ra1 = ra1;
      const ra2 = window.localStorage.getItem("zizura2");
      this.tableState.ra2 = ra2;
      const ra3 = window.localStorage.getItem("zizura3");
      this.tableState.ra3 = ra3;
      const rx_a1 = window.localStorage.getItem("zizurx_a1");
      this.tableState.rx_a1 = rx_a1;
      const rx_a2 = window.localStorage.getItem("zizurx_a2");
      this.tableState.rx_a2 = rx_a2;
      const rx_a3 = window.localStorage.getItem("zizurx_a3");
      this.tableState.rx_a3 = rx_a3;
      const rx = window.localStorage.getItem("zizurx");
      this.tableState.rx = rx;

      const rb1 = window.localStorage.getItem("zizurb1");
      this.tableState.rb1 = rb1;
      const rb2 = window.localStorage.getItem("zizurb2");
      this.tableState.rb2 = rb2;
      const rb3 = window.localStorage.getItem("zizurb3");
      this.tableState.rb3 = rb3;
      const ra_change1 = window.localStorage.getItem("zizura_change1");
      this.tableState.ra_change1 = ra_change1;
      const ra_change2 = window.localStorage.getItem("zizura_change2");
      this.tableState.ra_change2 = ra_change2;
      const ra_change3 = window.localStorage.getItem("zizura_change3");
      this.tableState.ra_change3 = ra_change3;
      const s1 = window.localStorage.getItem("zizus1");
      this.tableState.s1 = s1;
      const s2 = window.localStorage.getItem("zizus2");
      this.tableState.s2 = s2;
      const s3 = window.localStorage.getItem("zizus3");
      this.tableState.s3 = s3;
      const s = window.localStorage.getItem("zizus");
      this.tableState.s = s;
      const rc1 = window.localStorage.getItem("zizurc1");
      this.tableState.rc1 = rc1;
      const rc2 = window.localStorage.getItem("zizurc2");
      this.tableState.rc2 = rc2;
      const rc3 = window.localStorage.getItem("zizurc3");
      this.tableState.rc3 = rc3;
      const rx_b1 = window.localStorage.getItem("zizurx_b1");
      this.tableState.rx_b1 = rx_b1;
      const rx_b2 = window.localStorage.getItem("zizurx_b2");
      this.tableState.rx_b2 = rx_b2;
      const rx_b3 = window.localStorage.getItem("zizurx_b3");
      this.tableState.rx_b3 = rx_b3;
      const rxx = window.localStorage.getItem("zizurxx");
      this.tableState.rxx = rxx;
      const rd1 = window.localStorage.getItem("zizurd1");
      this.tableState.rd1 = rd1;
      const rd2 = window.localStorage.getItem("zizurd2");
      this.tableState.rd2 = rd2;
      const rd3 = window.localStorage.getItem("zizurd3");
      this.tableState.rd3 = rd3;
      const rb_change1 = window.localStorage.getItem("zizurb_change1");
      this.tableState.rb_change1 = rb_change1;
      const rb_change2 = window.localStorage.getItem("zizurb_change2");
      this.tableState.rb_change2 = rb_change2;
      const rb_change3 = window.localStorage.getItem("zizurb_change3");
      this.tableState.rb_change3 = rb_change3;
      const ss1 = window.localStorage.getItem("zizuss1");
      this.tableState.ss1 = ss1;
      const ss2 = window.localStorage.getItem("zizuss2");
      this.tableState.ss2 = ss2;
      const ss3 = window.localStorage.getItem("zizuss3");
      this.tableState.ss3 = ss3;
      const ss = window.localStorage.getItem("zizuss");
      this.tableState.ss = ss;
      // const xz1 = window.localStorage.getItem("zizuxz1");
      // this.tableState.xz1 = xz1;
      // const xz2 = window.localStorage.getItem("zizuxz2");
      // this.tableState.xz2 = xz2;
      // const thir_one_four = window.localStorage.getItem("pd1");
      // this.tableState.thir_one_four = thir_one_four;
      // const pd2 = window.localStorage.getItem("zizupd2");
      // this.tableState.pd2 = pd2;
      // const grade_xp = window.localStorage.getItem("zizugrade_xp");
      // this.tableState.grade_xp = grade_xp;
      const one = window.localStorage.getItem("zizuone");
      this.Form.one = one;
      const two = window.localStorage.getItem("zizutwo");
      this.Form.two = two;
      const pone = window.localStorage.getItem("zizupone");
      this.Form.pone = pone;
      const ptwo = window.localStorage.getItem("zizuptwo");
      this.Form.ptwo = ptwo;
      // for (var key in this.tableState) {
      //   // console.log(this.form2[key]);
      //   if (this.tableState[key] == 'null') {
      //     this.tableState[key] = ''
      //     // return false;
      //   }
      // }
      // for (var key in this.Form) {
      //   // console.log(this.Form[key]);
      //   if (this.Form[key] == 'null') {
      //     this.Form[key] = ''
      //     // return false;
      //   }
      // }
    },
  },
  }
</script>

<style scoped>
.all {
  height: 100%;
  width: 50%;
  min-width: 320px;
  margin: 0 auto;
  text-align: left;
}
.btn {
  width: 20%;
  margin-bottom: 2vw;
}
.footer {
  text-align: center;
}
.el-radio-group {
  margin: 10px;
}
.el-radio {
  padding: 5px;
}
</style>
